package br3akr.DeadlyDinnerParty.Server.World;

import java.util.HashSet;
import java.util.Set;

public class Body implements IsHidable {
	int age;
	boolean isHidden;
	String hiddenDesc;
	GameCharacter character;
	public GameCharacter getCharacter() {
		return character;
	}

	String howKilled;
	private GameCharacter killer;
	private Weapon murderWeapon;
	private Set<GameCharacter> hiddenFromList;
	
	public Body(GameCharacter c, String howKilled) {
		this.character = c;
		this.howKilled = howKilled;
		hiddenFromList = new HashSet<GameCharacter>();
	}
	
	public String getHowKilled() {
		return howKilled;
	}
	
	public String getDescription(int curDay) {
		return "The body of " + character.getName() + " lies here. The corpse looks like it has been rotting for " + (age - curDay) + " day(s)";
	}

	public GameCharacter getKiller() {
		return killer;
	}

	public void setKiller(GameCharacter killer) {
		this.killer = killer;
	}

	public Weapon getMurderWeapon() {
		return murderWeapon;
	}

	public void setMurderWeapon(Weapon murderWeapon) {
		this.murderWeapon = murderWeapon;
	}

	@Override
	public boolean isHiddenFrom(GameCharacter c) {
		return hiddenFromList.contains(c);
	}

	@Override
	public void addHiddenFrom(GameCharacter c) {
		hiddenFromList.add(c);
	}

	@Override
	public void removeHiddenFrom(GameCharacter c) {
		hiddenFromList.remove(c);
	}

	@Override
	public void hide(String hideDesc) {
		isHidden = true;
		hiddenDesc = hideDesc;
	}

	@Override
	public void unhide() {
		isHidden = false;
		hiddenDesc = null;
	}
	
	@Override
	public boolean isHidden() {
		return isHidden;
	}
	
	@Override
	public String getHiddenDescription() {
		return hiddenDesc;
	}
}
